package me.tuyou.mybatis.test.interfaces.mapper;

import me.tuyou.mybatis.test.interfaces.po.Subject;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;

public interface SubjectMapper {

    @Delete("drop table if exists subject")
    void dropTable();

    @Insert("create table subject (name varchar(32) not null primary key)")
    void createTable();

    @Insert("insert into subject values ('数学'), ('语文'), ('英语')")
    int initData();

    @Select("select * from subject where name = #{0}")
    Subject get(String name);
}
